package provider;

import anaydis.sort.Sorter;
import anaydis.sort.SorterType;
import anaydis.sort.provider.SorterProvider;
import impl.*;
import org.jetbrains.annotations.NotNull;

import java.util.EnumMap;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: Keevu
 * Date: 24/08/11
 * Time: 15:22
 * To change this template use File | Settings | File Templates.
 */
public class SorterProviderImpl implements SorterProvider {
    private Map<SorterType, Sorter> mapa;

    public SorterProviderImpl() {
        mapa = new EnumMap<SorterType, Sorter>(SorterType.class);
      /*  mapa.put(SorterType.BUBBLE,new BubbleSorter());
        mapa.put(SorterType.INSERTION,new InsertionSorter());
        mapa.put(SorterType.SELECTION,new SelectionSort());
        mapa.put(SorterType.H,new HSorter());
        mapa.put(SorterType.SHELL,new ShellSorter());
       mapa.put(SorterType.QUICK,new QuickSorter());
        mapa.put(SorterType.QUICK_CUT, new HibridSorter());
        mapa.put(SorterType.QUICK_MED_OF_THREE, new QuickSorterMedianOfThree());
        mapa.put(SorterType.QUICK_NON_RECURSIVE, new QuickSorterNoRecursivo());
        mapa.put(SorterType.QUICK_THREE_PARTITION, new QuickSorterThreeWayPartition());
        mapa.put(SorterType.MERGE_BOTTOM_UP, new MergeSorterBottomUm());
        mapa.put(SorterType.MERGE, new MergeSorterTopDown());
    */
        mapa.put(SorterType.HEAP,new HeapSorterThreeLeaf());
        mapa.put(SorterType.HEAP, new HeapSorter());

    }



    @NotNull
    public Sorter getSorterForType(@NotNull SorterType sorterType) {
        return mapa.get(sorterType);
    }

    @NotNull
    public Iterable<Sorter> getAllSorters() {
        return mapa.values();
    }
}
